import { _decorator, Component, Node } from 'cc';
import { TalentItem } from './TalentItem';
import { ETalent } from '../core/Talent';
import { Core } from '../core/Core';
const { ccclass, property } = _decorator;
/**
 * 天赋面板
 */
@ccclass('TalentView')
export class TalentView extends Component {

    @property(Node)
    powerTalent: Node;
    @property(Node)
    defenseTalent: Node;


    protected onEnable(): void {
        let tmgr= Core.instance.playerData.talentMgr;
        this.powerTalent.getComponent(TalentItem).init(tmgr.talentList[ETalent.POWER]);
        this.defenseTalent.getComponent(TalentItem).init(tmgr.talentList[ETalent.DEFENSE]);
    }
    protected onDestroy(): void {

    }

    start() {

    }

    update(deltaTime: number) {

    }

    private onColseCklick() {
        this.node.active = false;
    }
}


